package com.marktotop.learntwo;

import com.marktotop.learntwo.entity.TbUser;
import com.marktotop.learntwo.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

/**
 * 测试 Spring 整合 Mybatis综合案例
 * @author WXLD
 * @data 2021/4/18 - 18:52
 */
public class Main {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserService userService = (UserService) context.getBean("userService");
        TbUser user = new TbUser();
        user.setId(4);
        user.setSex(0);
        user.setModifyTime(new Date());
        System.out.println(user);
        boolean b = userService.updateUser(user);
        System.out.println(b);
    }
}
